package com.zhhtech.zhh.ui.utils

import android.text.TextUtils
import android.util.Log

/**
 * Created by vicky on 2016/11/3.
 */
object Logger {
    @JvmField
    var isDebug = true

    @JvmField
    var TAG = "Logger"

    @JvmStatic
    fun setTag(tag: String) {
        TAG = tag
    }

    @JvmStatic
    fun e(msg: String?) {
        e(TAG, msg, null)
    }

    @JvmStatic
    fun e(tr: Throwable?) {
        e(TAG, "", tr)
    }

    @JvmStatic
    fun e(tag: String?, msg: String?, tr: Throwable? = null) {
        if (isDebug) {
            if (TextUtils.isEmpty(msg)) {
                Log.e(tag, "输出为空", tr)
            } else {
                Log.e(tag, msg, tr)
            }
        }
    }
}